package com.hw.job_3;

public class CreditPackage extends Package implements CreditServerInterface {

    private double call_duration; // 通话时长
    private int message_count; // 短信条数

    public CreditPackage(double month_charge, double call_duration, int message_count) {
        super(month_charge);
        setCall_duration(call_duration);
        setMessage_count(message_count);
    }

    // 重写抽象类的抽象方法
    @Override
    public void showInfo() {
        System.out.println("通话套餐信息为：" + "通过时长 = " + getCall_duration() + ", 短信条数 = "
                + getMessage_count() + ", 每月资费 = " + getMonth_charge());
    }

    // 重写接口的抽象方法
    @Override
    public void creditServer(double call_duration, MobilePhoneCard mpc) {
        System.out.println("这个是通话接口服务, " + "通话分钟 = " + call_duration);
        mpc.show();
    }

    public double getCall_duration() {
        return call_duration;
    }

    public void setCall_duration(double call_duration) {
        this.call_duration = call_duration;
    }

    public int getMessage_count() {
        return message_count;
    }

    public void setMessage_count(int message_count) {
        this.message_count = message_count;
    }
}
